package o;

import android.view.View;
import android.widget.ListView;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.exposure.bean.ExposureDetail;
import java.util.ArrayList;
import java.util.List;

public class bft {
    private long ˊ;
    private ListView m2Listview;
    private int ˏ = 4;
    private o.bft.TimerTaskImp ॱ;

    class TimerTaskImp extends SomeTimerTask {
        private int ˋ;
        final /* synthetic */ bft ॱ;

        public TimerTaskImp(bft o_bft, int i) {
            this.ॱ = o_bft;
            this.ˋ = i;
        }

        protected int[] getVisibleImtePos() {
            int[] listVisibleItemPosi = new int[]{-1, -1};
            if (this.ॱ.m2Listview != null) {
                listVisibleItemPosi[0] = this.ॱ.m2Listview.getFirstVisiblePosition();
                listVisibleItemPosi[1] = this.ॱ.m2Listview.getLastVisiblePosition();
            }
            return listVisibleItemPosi;
        }

        protected boolean ˎ(int i) {
            View children = getListViewByPos(i);
            if (children == null) {
                return false;
            }
            cht o_cht;
            Object tag = children.getTag();
            if (tag instanceof cht) {
                o_cht = (cht) tag;
            } else {
                o_cht = null;
            }
            boolean ˎ = o_cht == null ? false : o_cht.ʽ() ? true : super.ˎ(i);
            return ˎ;
        }

        protected View getListViewByPos(int i) {
            return this.ॱ.m2Listview.getChildAt(i - this.ॱ.m2Listview.getFirstVisiblePosition());
        }

        protected List<ExposureDetail> ˏ(int i, int i2) {
            Object obj = evt.ˊ(this.ॱ.m2Listview) >= 50 ? 1 : null;
            ArrayList arrayList = new ArrayList();
            if (obj == null) {
                return arrayList;
            }
            while (i <= i2) {
                View ˏ = getListViewByPos(i);
                if (ˏ != null) {
                    cht o_cht = (cht) ˏ.getTag();
                    if (o_cht != null && o_cht.ˏॱ()) {
                        ArrayList z_;
                        ExposureDetail exposureDetail = new ExposureDetail();
                        ArrayList arrayList2 = new ArrayList();
                        if (o_cht.ॱ()) {
                            z_ = o_cht.z_();
                        } else {
                            int ˊॱ = o_cht.ˊॱ();
                            for (int i3 = 0; i3 < ˊॱ; i3++) {
                                cih ˎ = o_cht.ˎ(i3);
                                if (ˎ != null) {
                                    CardBean ˌ = ˎ.ˌ();
                                    if (ˌ != null) {
                                        if (ˌ instanceof BaseCardBean) {
                                            arrayList2.add(ˌ.ॱॱ() + "#$#" + ((BaseCardBean) ˌ).u_());
                                        } else {
                                            arrayList2.add(ˌ.ॱॱ());
                                        }
                                    }
                                }
                            }
                            z_ = arrayList2;
                        }
                        if (!CollectCheck.isEmpty((List) z_)) {
                            exposureDetail.ˎ(z_);
                            exposureDetail.ॱ(String.valueOf(o_cht.ˏ));
                            exposureDetail.ˏ(System.currentTimeMillis());
                            arrayList.add(exposureDetail);
                            ˋ(arrayList, o_cht);
                        }
                    }
                }
                i++;
            }
            return arrayList;
        }

        private void ˋ(ArrayList<ExposureDetail> arrayList, cht o_cht) {
            if ((o_cht instanceof cdr) && ((cdr) o_cht).ʻ() && ((cdr) o_cht).ॱॱ() != null) {
                ExposureDetail exposureDetail = new ExposureDetail();
                ArrayList z_ = o_cht.z_();
                if (z_ != null) {
                    exposureDetail.ˎ(z_);
                    exposureDetail.ॱ(String.valueOf(((cdr) o_cht).ॱॱ().ˏ));
                    exposureDetail.ˏ(System.currentTimeMillis());
                    arrayList.add(exposureDetail);
                }
            }
        }

        protected long ˊ() {
            return this.ॱ.ˊ;
        }

        protected int ˋ() {
            return this.ˋ;
        }
    }

    public bft(ListView listView) {
        this.m2Listview = listView;
    }

    public void ˎ() {
        this.ˊ = System.currentTimeMillis();
        this.ॱ = new o.bft.TimerTaskImp(this, this.ˏ);
        this.ॱ.ˏ();
    }
}
